package com.ay.wiki_plt.mapper;

import com.ay.wiki_plt.domain.Ebook;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;




public interface EbookMapper {


    /*查询全部电子图书*/

    List<Ebook> list(String name,Long category2Id);

    /*根据id查询电子书*/
    @Select("select * from ebook where id = #{id}")
    Ebook getByIdEbook(Integer id);

    /*保存电子书*/
    @Insert("insert into ebook(id,name, category1_id, category2_id, description, cover) " +
            "VALUES (#{id},#{name},#{category1Id},#{category2Id},#{description},#{cover})")
    void saveEbook(Ebook ebook);

    /*修改电子书信息*/
    void updateEbook(Ebook ebook);

    /*删除电子书*/
    void deleteByEbookList(List<Long> ids);
}
